<?php
class ContactModel extends Model{

    public function  __construct() {
        parent::Model();
    }

    public function find(){
        $this->db->where('id',1);
        $this->db->limit(1);
        $query = $this->db->get('contact');
        return $query->num_rows()==1?$query->row():false;
    }

    public function add(){
        $data['telephone']=$this->input->post('telephone');
        $data['email']=$this->input->post('email');
        $data['address']=$this->input->post('address');
        $this->db->insert('contact',$data);
    }

    public function update(){
        $data['telephone']=$this->input->post('telephone');
        $data['email']=$this->input->post('email');
        $data['address']=$this->input->post('address');
        $this->db->update('contact',$data,array('id'=>1));
    }
}